import request from '@/utils/request';

export const getMenuList = (data) => {
  return request({
    url: '/console/permissions/getMenuList',
    method: 'POST',
    data,
  })
}
export const getMenu = (data) => {
  return request({
    url: '/console/permissions/getMenu',
    method: 'POST',
    data,
  })
}
export const addMenu = (data) => {
  return request({
    url: '/console/permissions/addMenu',
    method: 'POST',
    data,
  })
}
export const delMenu = (data) => {
  return request({
    url: '/console/permissions/delMenu',
    method: 'POST',
    data,
  })
}
export const updateMenu = (data) => {
  return request({
    url: '/console/permissions/updateMenu',
    method: 'POST',
    data,
  })
}
// 角色

export const getRoleList = (data) => {
  return request({
    url: '/console/permissions/getRoleList',
    method: 'POST',
    data,
  })
}

export const getRoleMenuList = (data) => {
  return request({
    url: '/console/permissions/getRoleMenuList',
    method: 'POST',
    data,
  })
}
export const addRole = (data) => {
  return request({
    url: '/console/permissions/addRole',
    method: 'POST',
    data,
  })
}
export const updateRole = (data) => {
  return request({
    url: '/console/permissions/updateRole',
    method: 'POST',
    data,
  })
}
export const updateRoleState = (data) => {
  return request({
    url: '/console/permissions/updateRoleState',
    method: 'POST',
    data,
  })
}
export const delRole = (data) => {
  return request({
    url: '/console/permissions/delRole',
    method: 'POST',
    data,
  })
}
// 用户
export const getUserList = (data) => {
  return request({
    url: '/console/backUser/getUserList',
    method: 'POST',
    data,
  })
}
export const editUser = (data) => {
  return request({
    url: '/console/backUser/editUser',
    method: 'POST',
    data,
  })
}